package com.liliudong.pinkyponk.biz.sys.request;

import com.liliudong.pinkyponk.biz.sys.enums.SysMenuMenuType;
import com.liliudong.pinkyponk.core.validator.Create;
import com.liliudong.pinkyponk.core.validator.Update;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * SysMenu
 *
 * @author liliudong
 * @date 2022-07-04 15:16
 **/
@Data
public class SysMenuRequest implements Serializable {

    /**
     * 主键
     */
    @NotNull(groups = {Update.class}, message = "Id不能为空")
    private Integer id;

    /**
     * 菜单名称
     */
    @NotEmpty(groups = {Create.class, Update.class}, message = "菜单名名称不能为空")
    @Length(groups = {Create.class,
            Update.class}, min = 1, max = 16, message = "菜单名称必须要在1~16个字符之间")
    private String menuName;

    /**
     * 图标
     */
    private String menuIcon;

    /**
     * 父菜单id
     */
    @NotNull(groups = {Create.class, Update.class}, message = "上级不能为空")
    private Integer parentId;

    /**
     * 菜单类型 1目录 2菜单 3按钮
     */
    @NotNull(groups = {Create.class, Update.class}, message = "菜单类型不能为空")
    private SysMenuMenuType menuType;

    /**
     * 权限标识
     */
    @NotEmpty(groups = {Create.class, Update.class}, message = "权限不能为空")
    private String authority;
    /**
     * 菜单排序
     */
    private Integer menuOrder;
    /**
     * 路由名称
     */
    private String routeName;
    /**
     * 路由地址
     */
    private String pagePath;
}
